#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <unistd.h>

void (*origin_handler)(int);
void handler(int signum){
	printf("%s\n",strsignal(signum));
}
int main(){
	if((origin_handler=signal(SIGALRM,handler))==SIG_ERR){
		perror("signal");
		exit(1);
	}
	alarm(3);
	pause();
	printf("Main ok\n");
	signal(SIGALRM,origin_handler);
	return 0;
}
